﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms;
using JumpJump.Runtime;

namespace JumpJump.UI
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.cvs_Table.messenger = this.tbx_messenger;
        }

        private void btn_RestartGame_Click(object sender, RoutedEventArgs e)
        {
            this.cvs_Table.Initinal();
        }

        private void btn_save_Click(object sender, RoutedEventArgs e)
        {
            this.cvs_Table.Save(true);
        }

        private void btn_Load_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "rep files (*.rep)|*.rep";
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string fileName = ofd.FileName;
                this.cvs_Table.Load(fileName);
            }
        }
    }
}
